import 'package:flutter/material.dart';
import 'package:flutter_ohos/app/common/grid_tile.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:get/get.dart';

import 'seven_logic.dart';
import 'seven_state.dart';

class SevenPage extends StatelessWidget {
  const SevenPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final SevenLogic logic = Get.put(SevenLogic());
    final SevenState state = Get.find<SevenLogic>().state;

    return GridView.custom(
      gridDelegate: SliverWovenGridDelegate.count(
        crossAxisCount: 2,
        mainAxisSpacing: 8,
        crossAxisSpacing: 8,
        pattern: [
          WovenGridTile(1),
          WovenGridTile(
            5 / 7,
            crossAxisRatio: 0.9,
            alignment: AlignmentDirectional.centerEnd,
          ),
        ],
      ),
      childrenDelegate: SliverChildBuilderDelegate(
            (context, index) => Tile(index: index),
      ),
    );
  }

}
